-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: stack /clear
messages
#5806
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pajlada
approved these changes
Jan 11, 2025
If I re-run the tests & make it write snapshots, this is the diff I get diff --git a/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json b/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json
index 0e0b1d11..bc235521 100644
--- a/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json
+++ b/tests/snapshots/IrcMessageHandler/clearchat-stack-always.json
@@ -1,90 +1,6 @@
{
"input": "@tmi-sent-ts=1736369068441;rm-received-ts=1736369068532;historical=1;room-id=111448817 :tmi.twitch.tv CLEARCHAT #pajlada",
"output": [
- {
- "badgeInfos": {
- },
- "badges": [
- ],
- "channelName": "",
- "count": 4,
- "displayName": "",
- "elements": [
- {
- "element": {
- "color": "System",
- "flags": "Timestamp",
- "link": {
- "type": "None",
- "value": ""
- },
- "style": "ChatMedium",
- "tooltip": "",
- "trailingSpace": true,
- "type": "TextElement",
- "words": [
- "20:44"
- ]
- },
- "flags": "Timestamp",
- "format": "",
- "link": {
- "type": "None",
- "value": ""
- },
- "time": "20:44:28",
- "tooltip": "",
- "trailingSpace": true,
- "type": "TimestampElement"
- },
- {
- "color": "System",
- "flags": "Text",
- "link": {
- "type": "None",
- "value": ""
- },
- "style": "ChatMedium",
- "tooltip": "",
- "trailingSpace": true,
- "type": "TextElement",
- "words": [
- "Chat",
- "has",
- "been",
- "cleared",
- "by",
- "a",
- "moderator."
- ]
- },
- {
- "color": "System",
- "flags": "Text",
- "link": {
- "type": "None",
- "value": ""
- },
- "style": "ChatMedium",
- "tooltip": "",
- "trailingSpace": true,
- "type": "TextElement",
- "words": [
- "(4",
- "times)"
- ]
- }
- ],
- "flags": "System|DoNotTriggerNotification|ClearChat",
- "id": "",
- "localizedName": "",
- "loginName": "",
- "messageText": "Chat has been cleared by a moderator. (4 times) ",
- "searchText": "Chat has been cleared by a moderator. (4 times) ",
- "serverReceivedTime": "",
- "timeoutUser": "",
- "usernameColor": "#ff000000"
- },
{
"badgeInfos": {
},
@@ -219,6 +135,90 @@
"serverReceivedTime": "2025-01-08T20:44:24Z",
"timeoutUser": "",
"usernameColor": "#ffff0000"
+ },
+ {
+ "badgeInfos": {
+ },
+ "badges": [
+ ],
+ "channelName": "",
+ "count": 2,
+ "displayName": "",
+ "elements": [
+ {
+ "element": {
+ "color": "System",
+ "flags": "Timestamp",
+ "link": {
+ "type": "None",
+ "value": ""
+ },
+ "style": "ChatMedium",
+ "tooltip": "",
+ "trailingSpace": true,
+ "type": "TextElement",
+ "words": [
+ "20:44"
+ ]
+ },
+ "flags": "Timestamp",
+ "format": "",
+ "link": {
+ "type": "None",
+ "value": ""
+ },
+ "time": "20:44:28",
+ "tooltip": "",
+ "trailingSpace": true,
+ "type": "TimestampElement"
+ },
+ {
+ "color": "System",
+ "flags": "Text",
+ "link": {
+ "type": "None",
+ "value": ""
+ },
+ "style": "ChatMedium",
+ "tooltip": "",
+ "trailingSpace": true,
+ "type": "TextElement",
+ "words": [
+ "Chat",
+ "has",
+ "been",
+ "cleared",
+ "by",
+ "a",
+ "moderator."
+ ]
+ },
+ {
+ "color": "System",
+ "flags": "Text",
+ "link": {
+ "type": "None",
+ "value": ""
+ },
+ "style": "ChatMedium",
+ "tooltip": "",
+ "trailingSpace": true,
+ "type": "TextElement",
+ "words": [
+ "(2",
+ "times)"
+ ]
+ }
+ ],
+ "flags": "System|DoNotTriggerNotification|ClearChat",
+ "id": "",
+ "localizedName": "",
+ "loginName": "",
+ "messageText": "Chat has been cleared by a moderator. (2 times) ",
+ "searchText": "Chat has been cleared by a moderator. (2 times) ",
+ "serverReceivedTime": "",
+ "timeoutUser": "",
+ "usernameColor": "#ff000000"
}
],
"params": {
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We stack timeouts, but not "full" clearchats. There's no use in having a chat full of "Chat has been cleared by a moderator".
This PR adds similar stacking functionality to
/clear
messages (both from PubSub and from IRC). Additionally, the user is now clickable in PubSub messages ("{actor} cleared the chat"). Tests for the different stacking settings have been added as well (it reuses the timeout stacking).